package model;

import ilog.concert.IloException;
import ilog.concert.IloLPMatrix;
import ilog.concert.IloNumVar;
import ilog.cplex.IloCplex;

public class example {

	public static void main(String[] args) {
		IloCplex cplex = null;
		try {
			cplex = new IloCplex();
			cplex.importModel("TSP.10.mps");
			cplex.solve();
			cplex.exportModel("TSP.10.lp");
			IloLPMatrix lp = (IloLPMatrix)cplex.LPMatrixIterator().next();
		    IloNumVar[] vars = lp.getNumVars();
			IloNumVar changedVar = cplex.numVar(555, 555,vars[40].getName());
			cplex.addEq(10.0, changedVar);
			cplex.exportModel("TSP.changed.lp");
		} catch (IloException e) {
			e.printStackTrace();
		}
		cplex.end();
	}

}
